home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / arexx / easyrexx.lha / EasyREXX / Include / libraries / EasyREXX.h
Encoding:
C/C++ Source or Header  |  1995-02-10  |  2.1 KB  |  82 lines

  1. /*
  2.  *    File:                    EasyRexx.h
  3.  *    Description:    Headerfile for the easyrexx.library
  4.  *
  5.  *    (C) 1994,1995, Ketil Hunn
  6.  *
  7.  *    Set Tab=2 for best readability
  8.  *
  9.  */
  10.  
  11. #ifndef LIBRARIES_EASYREXX_H
  12. #define LIBRARIES_EASYREXX_H
  13.  
  14. #ifndef    EXEC_PORTS_H
  15. #include <exec/ports.h>
  16. #endif
  17.  
  18. #ifndef UTILITY_TAGITEM_H
  19. #include <utility/tagitem.h>
  20. #endif
  21.  
  22. #define    EASYREXXNAME        "easyrexx.library"
  23. #define    EASYREXXVERSION    1L
  24.  
  25. #define    ER_SIGNAL(c)        (1L<<c->port->mp_SigBit)
  26. #define ARG(c,i)                (c->argv[i])
  27. #define    ARGNUMBER(c,i)    (*((LONG *)c->argv[i]))
  28. #define    ARGSTRING(c,i)    ((UBYTE *)c->argv[i])
  29. #define    ARGBOOL(c,i)        (c->argv[i]==NULL ? FALSE:TRUE)
  30. #define    TABLE_END                NULL,NULL,NULL,NULL
  31.  
  32. /***** STRUCTS ***********************************************************************/
  33.  
  34. struct ARexxCommandTable
  35. {
  36.     LONG    id;
  37.     UBYTE *command,
  38.                 *template;
  39.     APTR userdata;
  40. };
  41.  
  42. struct ARexxContext
  43. {
  44.     /* PRIVATE */
  45.     struct MsgPort                        *port;
  46.     struct ARexxCommandTable    *table;
  47.     UBYTE                                            *argcopy,
  48.                                                         *portname,
  49.                                                         maxargs;
  50.     struct RDArgs                            *rdargs;
  51.     struct RexxMsg                        *msg;
  52.     ULONG                                            flags;
  53.  
  54.     /* PUBLIC */
  55.     LONG                                            id,
  56.                                                         argv[0];
  57. };
  58.  
  59.  
  60. #ifndef CLIB_EASYREXX_PROTOS_H
  61. #include <clib/easyrexx_protos.h>
  62. #endif
  63.  
  64. #ifndef REXX_ERRORS_H
  65. #include <rexx/errors.h>
  66. #endif
  67.  
  68. /***** TAGS **************************************************************************/
  69.  
  70. #define    ER_TagBase                (TAG_USER)
  71. #define    ER_Portname                (ER_TagBase+1)    /* Name of AREXX port                                            */
  72. #define    ER_CommandTable        (ER_TagBase+2)    /* Table of supported AREXX commands            */
  73. #define    ER_ReturnCode            (ER_TagBase+3)    /* Primary result (return code)                        */
  74. #define    ER_Result                    (ER_ReturnCode)    /* Alias for ER_ReturnCode                                */
  75. #define    ER_Result1                (ER_ReturnCode)    /* Alias for ER_ReturnCode                                */
  76. #define    ER_Result2                (ER_TagBase+4)    /* Secondary result (string)                            */
  77. #define    ER_Port                        (ER_TagBase+5)    /* Use already created port                                */
  78. #define    ER_ResultString        (ER_TagBase+6)    /* Secondary result (string)                            */
  79. #define    ER_ResultLong            (ER_TagBase+7)    /* Secondary result (long)                                */
  80.  
  81. #endif
  82.